﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading;
using System.Windows;

namespace ShareFolder
{
    public class GClass1 : INotifyPropertyChanged
    {
        private bool bool_0;
        private PropertyChangedEventHandler propertyChangedEventHandler_0;

        private string string_0;

        private string string_1;

        private string string_2;

        private int int_0;

        private bool bool_1;
        public event PropertyChangedEventHandler PropertyChanged
        {
            add
            {
                PropertyChangedEventHandler propertyChangedEventHandler = this.propertyChangedEventHandler_0;
                PropertyChangedEventHandler propertyChangedEventHandler2;
                do
                {
                    propertyChangedEventHandler2 = propertyChangedEventHandler;
                    PropertyChangedEventHandler propertyChangedEventHandler3 = (PropertyChangedEventHandler)Delegate.Combine(propertyChangedEventHandler2, value);
                    propertyChangedEventHandler = Interlocked.CompareExchange<PropertyChangedEventHandler>(ref this.propertyChangedEventHandler_0, propertyChangedEventHandler3, propertyChangedEventHandler2);
                }
                while (propertyChangedEventHandler != propertyChangedEventHandler2);
            }
            remove
            {
                PropertyChangedEventHandler propertyChangedEventHandler = this.propertyChangedEventHandler_0;
                PropertyChangedEventHandler propertyChangedEventHandler2;
                do
                {
                    propertyChangedEventHandler2 = propertyChangedEventHandler;
                    PropertyChangedEventHandler propertyChangedEventHandler3 = (PropertyChangedEventHandler)Delegate.Remove(propertyChangedEventHandler2, value);
                    propertyChangedEventHandler = Interlocked.CompareExchange<PropertyChangedEventHandler>(ref this.propertyChangedEventHandler_0, propertyChangedEventHandler3, propertyChangedEventHandler2);
                }
                while (propertyChangedEventHandler != propertyChangedEventHandler2);
            }
        }
        public string Path
        {
            get;
            set;
        }
        public string FileName
        {
            get;
            set;
        }
        public string ImageSrc
        {
            get;
            set;
        }
        public string Size
        {
            get
            {
                if (this.FileSize == 0)
                {
                    return "";
                }
                string result;
                if (this.FileSize / 1024 > 1)
                {
                    if (Math.Round((double)this.FileSize / 1048576.0) > 1.0)
                    {
                        result = Math.Round((double)this.FileSize / 1048576.0, 2).ToString() + " MB";
                    }
                    else
                    {
                        result = Math.Round((double)this.FileSize / 1024.0, 2).ToString() + " KB";
                    }
                }
                else
                {
                    result = this.FileSize.ToString() + " bytes";
                }
                return result;
            }
        }
        public int FileSize
        {
            get;
            set;
        }
        public bool IsDirectory
        {
            get;
            set;
        }
        public bool Checked
        {
            get
            {
                return this.bool_0;
            }
            set
            {
                this.bool_0 = value;
                this.method_0("Checked");
            }
        }
        public bool IsImage
        {
            get
            {
                string text = System.IO.Path.GetExtension(this.FileName).ToUpper();
                return text == ".JPG" || text == ".PNG" || text == ".GIF" || text == ".BMP";
            }
        }
        public bool IsAudio
        {
            get
            {
                string text = System.IO.Path.GetExtension(this.FileName).ToUpper();
                return this.IsRingTone || text == ".WMV" || text == ".AVI";
            }
        }
        public bool IsRingTone
        {
            get
            {
                string text = System.IO.Path.GetExtension(this.FileName).ToUpper();
                return text == ".MP3" || text == ".WMA";
            }
        }
        public bool IsTextFile
        {
            get
            {
                string text = System.IO.Path.GetExtension(this.FileName).ToUpper();
                return text == ".TXT" || text == ".XML";
            }
        }
        public bool IsViewable
        {
            get
            {
                return this.IsImage || this.IsTextFile;
            }
        }
        public Visibility SizeVisible
        {
            get
            {
                if (this.IsDirectory)
                {
                    return (Visibility)1;
                }
                return (Visibility)0;
            }
        }
        private void method_0(string string_3)
        {
            PropertyChangedEventHandler propertyChangedEventHandler = this.propertyChangedEventHandler_0;
            if (propertyChangedEventHandler != null)
            {
                propertyChangedEventHandler.Invoke(this, new PropertyChangedEventArgs(string_3));
            }
        }
    }
}
